<?php
/**
 * licenses : MIT
 * creatTime: 2020/5/14
 * author : weblinuxgame
 * filename: AttachmentsApi.php
 */

namespace App\Api\Modules\Attachments;

use Illuminate\Http\Request;
use Illuminate\Http\Response;
use OpenApi\Annotations as OA;

/**
 * @OA\Tag(
 *     name="Attachments",
 *     description="## 附件接口集合",
 * )
 */

/**
 * Interface AttachmentsApi
 * @package App\Api\Attachments
 */
interface AttachmentsApi
{
    /**
     * @OA\Post(
     *     path="/upload",
     *     tags={"Attachments"},
     *     summary="Update Simple file",
     *     description="上传单个文件",
     *     operationId="updateFile",
     *     @OA\RequestBody(
     *      required=true,
     *      @OA\MediaType(
     *             mediaType="multipart/form-data",
     *             @OA\Schema(
     *                 @OA\Property(
     *                     description="上传临牌",
     *                     property="accessToken",
     *                     type="string",
     *                     default="78805a221a988e79ef3f42d7c5bfd418",
     *                 ),
     *                 @OA\Property(
     *                     description="上传文件",
     *                     property="file",
     *                     type="file",
     *                     format="file",
     *                     default="default.png",
     *                 ),
     *                 required={"file","accessToken"}
     *             ),
     *         )
     *   ),
     *   @OA\Parameter(
     *       name="X-AppVer",
     *       in="header",
     *       description="app version,eg:2.0.0 ",
     *       @OA\Schema(
     *          type="string",
     *          format="string",
     *          default="0.0.1",
     *       ),
     *   ),
     *   @OA\Parameter(
     *         description="登陆令牌",
     *         in="header",
     *         name="Authentication",
     *         required=true,
     *         @OA\Schema(
     *             type="string",
     *             format="string"
     *         ),
     *        example="098f6bcd4621d373cade4e832627b4f6",
     *     ),
     *   @OA\Response(
     *         response="200",
     *         description="接口响应数据",
     *         @OA\JsonContent(
     *           type="object",
     *           @OA\Items(ref="#/components/schemas/ApiResponse"),
     *           examples={
     *              "上传成功":{  "value": {"code":200,"message":"ok","data":null } },
     *              "上传失败":{  "value": {"code":0,"message":"failed","data":null} },
     *           }
     *       ),
     *   ),
     * )
     */


    /**
     * 上传单个文件
     * @param Request $request
     * @return Response
     */
    public function upload(Request $request);

    /**
     * @OA\Post(
     *     path="/uploads",
     *     tags={"Attachments"},
     *     summary="Update Mutil file",
     *     description="上传多个个文件",
     *     operationId="updateFiles",
     *     @OA\RequestBody(
     *      required=true,
     *      @OA\MediaType(
     *             mediaType="multipart/form-data",
     *             @OA\Schema(
     *                 @OA\Property(
     *                     description="上传临牌",
     *                     property="accessToken",
     *                     type="string",
     *                     default="78805a221a988e79ef3f42d7c5bfd418",
     *                 ),
     *                 @OA\Property(
     *                     description="上传文件组",
     *                     property="files[]",
     *                     type="array",
     *                     @OA\Items(
     *                          type="file",
     *                          format="file",
     *                      )
     *                 ),
     *                 required={"files[]","accessToken"}
     *             ),
     *         )
     *   ),
     *   @OA\Parameter(
     *       name="X-AppVer",
     *       in="header",
     *       description="app version,eg:2.0.0 ",
     *       @OA\Schema(
     *          type="string",
     *          format="string",
     *          default="0.0.1",
     *       ),
     *   ),
     *   @OA\Parameter(
     *         description="登陆令牌",
     *         in="header",
     *         name="Authentication",
     *         required=true,
     *         @OA\Schema(
     *             type="string",
     *             format="string"
     *         ),
     *        example="098f6bcd4621d373cade4e832627b4f6",
     *     ),
     *   @OA\Response(
     *         response="200",
     *         description="接口响应数据",
     *         @OA\JsonContent(
     *           type="object",
     *           @OA\Items(ref="#/components/schemas/ApiResponse"),
     *           examples={
     *              "上传成功":{  "value": {"code":200,"message":"ok","data":null } },
     *              "上传失败":{  "value": {"code":0,"message":"failed","data":null} },
     *           }
     *       ),
     *   ),
     * )
     */

    /**
     * 上传多文件
     * @param Request $request
     * @return Response
     */
    public function uploads(Request $request);

}
